package com.cskaoyan.servlet;

import com.cskaoyan.bean.MarketGoods;
import com.cskaoyan.bean.common.BaseRespVo;
import com.cskaoyan.service.GroupGoodsManagementService;
import com.cskaoyan.service.GroupGoodsManagementServiceImpl;
import com.cskaoyan.util.JacksonUtil;
import com.cskaoyan.util.ResponseUtil;

import javax.servlet.annotation.WebServlet;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import java.io.IOException;
import java.text.ParseException;

@WebServlet("/admin/goods/delete")
public class GroupGoodsManagementDeleteServlet extends WdBaseServlet{
    private void delete(HttpServletRequest request, HttpServletResponse response) throws ParseException, IOException {
        GroupGoodsManagementService groupgoodsManagementService = new GroupGoodsManagementServiceImpl();

        // 读取请求body
        String json = request.getReader().readLine();

        // Jackson解析

        MarketGoods goods = JacksonUtil.read(json, MarketGoods.class);



        groupgoodsManagementService.groupDeleteGoods(goods);


        ResponseUtil.responseJson(response, BaseRespVo.ok());

    }

}
